﻿@model IEnumerable<Forest.Cat.Web.Models.Catalog.JobPositionModel> 
<script language="javascript"><!--
    function senfe(o, a, b, c) {
        var t = document.getElementById(o).getElementsByTagName("tr");
        for (var i = 0; i < t.length; i++) {
            t[i].style.backgroundColor = (t[i].sectionRowIndex % 2 == 0) ? a : b;
            t[i].onclick = function () {
                if (this.x != "1") {
                    this.x = "1";
                }
                else {
                    this.x = "0";
                    this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a : b;
                }
            }
            t[i].onmouseover = function () {
                if (this.x != "1") this.style.backgroundColor = c;
            }
            t[i].onmouseout = function () {
                if (this.x != "1") this.style.backgroundColor = (this.sectionRowIndex % 2 == 0) ? a : b;
            }
        }
    }
--></script>
<table cellpadding="0" cellspacing="0" id="senfe">
    <tr>
        <th>
            职位名称
        </th>
        <th>
            工作地点
        </th>
        <th>
            发布日期
        </th>
        <th>
            截止日期
        </th>
        <th>
            招聘人数
        </th>
    </tr>
    @foreach (var item in Model) { 
        <tr>
            <td style="text-align: left; padding-left: 10px">
                @Html.ActionLink(item.JobTitle, "JobView", "CataLog", new { id = item.Id }, null)
            </td>
            <td>
                @item.CityName
                @(!String.IsNullOrWhiteSpace(item.DistrictName) ? " - " + item.DistrictName : String.Empty)
            </td>
            <td>
                @item.Reposted.Value.ToString("yyyy-MM-dd")
            </td>
            <td>
                @item.EndDate.Value.ToString("yyyy-MM-dd")
            </td>
            <td>
                @{
        if (item.Wants == 0) {
                    @Html.Raw("若干");
        }
        else {
                    @Html.Raw(item.Wants.ToString());
        }
                }
            </td>
        </tr>
    }
</table>
<script language="javascript"><!--
    //senfe("表格名称","奇数行背景","偶数行背景","鼠标经过背景","点击后背景");
    senfe("senfe", "#fafafa", "#fff", "#fcfcca");
--></script>
